package com.ruoyi.fjtseac.util;

import com.ruoyi.fjtseac.domain.dto.*;
import com.ruoyi.fjtseac.domain.po.*;
import com.ruoyi.fjtseac.domain.vo.*;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author zzl
 * @date 2022/7/21 15:39
 */
@Mapper
public interface DtoToPoMapper {

    DtoToPoMapper INSTANCE = Mappers.getMapper(DtoToPoMapper.class);

    @Mapping(target = "photoUrl", ignore = true)
    @Mapping(target = "essayId", ignore = true)
    Photo toPhoto(PhotoDto photoDto);

    @Mapping(target = "createTime", ignore = true)
    Essay toEssay(EssayDto essayDto);

    @Mapping(target = "videoUrl", ignore = true)
    @Mapping(target = "duration", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    Video toVideo(VideoDto videoDto);

    @Mapping(target = "videoUrl", ignore = true)
    @Mapping(target = "duration", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    Video toVideo(UpdateVideoForm updateVideoForm);

    @Mapping(target = "duration", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "audioUrl", ignore = true)
    Audio toAudio(AudioDto audioDto);

    Type toType(TypeDto typeDto);

    User toUser(UserDto userDto);

    Volunteer toVolunteer(VolunteerDto volunteerDto);

    ApplicationForm toApplicationForm(ApplicationFormDto applicationFormDto);
}
